package com.itheima.health.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.health.dao.MemberDao;
import com.itheima.health.pojo.Member;
import com.itheima.health.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author zhengjd
 * @date 2020/4/8 11:10
 */
@Transactional
@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    MemberDao memberDao;
    /**
     * 查询用户是否为会员(不是则自动注册为会员)
     * @param telephone
     * @return
     */
    @Override
    public Member findByTelephone(String telephone) {

        return memberDao.findByTelephone(telephone);
    }

    @Override
    public void add(Member member) {
        memberDao.add(member);
    }
}
